<template>
  <div class="main-layout">
    <div class="main-top-lay">
      <PageHeader style="flex:1;border: none;" :headHei='50' :title="systemTitle"
                  :logo="logo" :user="userInfo"  :menus="menus" ref="headerRef"/>
    </div>
    <div class="main-router">
      <RouteView style="flex: 1; height: 100%;"/>
    </div>
    <PageFooter/>
  </div>
</template>

<script setup lang="ts">

import {useStore} from "@/stores";
import {computed, onMounted, ref, shallowRef} from "vue";
import PageHeader from "@/components/common/PageTopNav.vue";
import PageFooter from "@/components/common/PageFooter.vue";
import RouteView from "@/components/common/RouteWrap.vue";

const logo = 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg';

const store = useStore();
const systemTitle = shallowRef('统一认证中心');
let headerRef = shallowRef(null);
let menus = ref<MenuType[]>(store.getTopMenus() || []);

const userInfo = computed(() => {
  return store.getUser();
});

onMounted(() => {

})

</script>

<style scoped>
.main-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-top-lay {
  width: 100%;
  display: flex;
  flex-direction: row;
}

.main-router {
  flex: 1;
  overflow: hidden;
}

</style>
